package com.bw.controller;

import com.alibaba.fastjson2.JSONObject;
import com.bw.service.GmallService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;
import java.util.Map;

@RestController
public class GmallController {
    @Autowired
    GmallService gmallService;

    @RequestMapping("/findPro")
    public Object findPro(){
        List<Map> list = gmallService.findPro();
        JSONObject jsonObject = new JSONObject();
        jsonObject.put("status",0);
        jsonObject.put("map","");
        jsonObject.put("data",list.get(0).get("sum(total_amount)"));
        return jsonObject;
    }
}
